$OpenBSD: patch-scripts_xdg-mime_in,v 1.4 2017/05/09 07:11:55 ajacoutot Exp $

Index: scripts/xdg-mime.in
--- scripts/xdg-mime.in.orig
+++ scripts/xdg-mime.in
@@ -421,6 +421,9 @@ defapp_generic()
        for prefix in "$XDG_MENU_PREFIX" ""; do
           DEBUG 2 "Checking $x/applications/${prefix}defaults.list and $x/applications/${prefix}mimeinfo.cache"
           trader_result=`grep "$MIME=" $x/applications/${prefix}defaults.list $x/applications/${prefix}mimeinfo.cache 2> /dev/null | head -n 1 | cut -d '=' -f 2 | cut -d ';' -f 1`
+          if [ -z "$trader_result" ] ; then
+              trader_result=`grep "$MIME=" $x/applications/mimeinfo.cache 2>/dev/null | cut -d '=' -f 2 | cut -d ';' -f 1`
+          fi
           if [ -n "$trader_result" ] ; then
               echo $trader_result
               exit_success
